package cn.brondfish.icedfish.framework.option;

import cn.brondfish.icedfish.R;

public enum AppThemeEnum {
    LIGHT(R.string.app_theme_light,"light"),
    DARK(R.string.app_theme_dark,"dark"),
    AUTO(R.string.app_theme_auto,"auto");

    private int value;
    private String key;

    AppThemeEnum(Integer value,String key) {
        this.value = value;
        this.key = key;
    }

    public int getValue() {
        return value;
    }

    public String getKey() {
        return key;
    }

    public static AppThemeEnum findByKey(String key) {
        AppThemeEnum result = AppThemeEnum.AUTO;
        switch (key) {
            case "light":
                result = AppThemeEnum.LIGHT;
                break;
            case "dark":
                result = AppThemeEnum.DARK;
                break;
            case "auto":
                result = AppThemeEnum.AUTO;
                break;
            default:
                result = null;
                break;
        }
        return result;
    }

    public static AppThemeEnum[] getIds(){
        return new AppThemeEnum[] {
                AppThemeEnum.LIGHT,
                AppThemeEnum.DARK,
                AppThemeEnum.AUTO,
        };
    }
}
